<?php



class ProductsAttributesMapBuilder {

	
	const CLASS_NAME = 'lib.model.map.ProductsAttributesMapBuilder';

	
	private $dbMap;

	
	public function isBuilt()
	{
		return ($this->dbMap !== null);
	}

	
	public function getDatabaseMap()
	{
		return $this->dbMap;
	}

	
	public function doBuild()
	{
		$this->dbMap = Propel::getDatabaseMap('propel');

		$tMap = $this->dbMap->addTable('products_attributes');
		$tMap->setPhpName('ProductsAttributes');

		$tMap->setUseIdGenerator(true);

		$tMap->addPrimaryKey('PRODUCTS_ATTRIBUTES_ID', 'ProductsAttributesId', 'int', CreoleTypes::INTEGER, true, null);

		$tMap->addForeignKey('PRODUCTS_ID', 'ProductsId', 'int', CreoleTypes::INTEGER, 'products', 'PRODUCTS_ID', true, null);

		$tMap->addForeignKey('OPTIONS_ID', 'OptionsId', 'int', CreoleTypes::INTEGER, 'products_options', 'PRODUCTS_OPTIONS_ID', true, null);

		$tMap->addForeignKey('OPTIONS_VALUES_ID', 'OptionsValuesId', 'int', CreoleTypes::INTEGER, 'products_options_values', 'PRODUCTS_OPTIONS_VALUES_ID', true, null);

		$tMap->addColumn('OPTIONS_VALUES_PRICE', 'OptionsValuesPrice', 'double', CreoleTypes::DECIMAL, true, 15);

		$tMap->addColumn('PRICE_PREFIX', 'PricePrefix', 'string', CreoleTypes::CHAR, true, 1);

	} 
} 